<div class="form-group">
    <label for="settingnew[mail_open]" class="col-sm-2 control-label">开启SMTP</label>
    <div class="col-sm-10">
        <label class="radio-inline">
            <input type="radio" name="settingnew[mail_open]" {{if $setting['mail_open'] eq '0'}}checked{{/if}} value=0> 关闭
        </label>
        <label class="radio-inline">
            <input type="radio" name="settingnew[mail_open]" {{if $setting['mail_open'] eq '1'}}checked{{/if}} value=1 > 开启
        </label>
    </div>
</div>
<div class="form-group">
    <label for="settingnew[mail_server]" class="col-sm-2 control-label">SMTP服务器</label>
    <div class="col-sm-10">
        <input class="form-control" name="settingnew[mail_server]" value="{{$setting['mail_server']}}"  datatype="*" nullmsg="请输入SMTP服务器！">
    </div>
</div>
<div class="form-group">
    <label for="settingnew[mail_port]" class="col-sm-2 control-label">SMTP 端口</label>
    <div class="col-sm-10">
        <input class="form-control" name="settingnew[mail_port]" value="{{$setting['mail_port']}}"  datatype="*" nullmsg="请输入SMTP服务器端口！">
    </div>
</div>
<div class="form-group">
    <label for="settingnew[mail_from]" class="col-sm-2 control-label">发件人地址</label>
    <div class="col-sm-10">
        <input class="form-control" name="settingnew[mail_from]" value="{{$setting['mail_from']}}"  datatype="*" nullmsg="请输入发件人地址！">
    </div>
</div>
<div class="form-group">
    <label for="settingnew[mail_auth]" class="col-sm-2 control-label">AUTH LOGIN验证</label>
    <div class="col-sm-10">
        <label class="radio-inline">
            <input type="radio" name="settingnew[mail_auth]" {{if $setting['mail_auth'] eq '0'}}checked{{/if}} value=0> 关闭
        </label>
        <label class="radio-inline">
            <input type="radio" name="settingnew[mail_auth]" {{if $setting['mail_auth'] eq '1'}}checked{{/if}} value=1 > 开启
        </label>
    </div>
</div>
<div class="form-group">
    <label for="settingnew[mail_user]" class="col-sm-2 control-label">验证用户名</label>
    <div class="col-sm-10">
        <input class="form-control" name="settingnew[mail_user]" value="{{$setting['mail_user']}}"  datatype="*" nullmsg="请输入验证用户名！">
    </div>
</div>
<div class="form-group">
    <label for="settingnew[mail_pass]" class="col-sm-2 control-label">验证密码</label>
    <div class="col-sm-10">
        <input class="form-control" name="settingnew[mail_pass]" value="{{$setting['mail_pass']}}"  datatype="*" nullmsg="请输入验证密码！">
    </div>
</div>
<div class="form-group">
    <label for="settingnew[mail_inbox]" class="col-sm-2 control-label">站点默认邮箱</label>
    <div class="col-sm-10">
        <input class="form-control" name="settingnew[mail_inbox]" value="{{$setting['mail_inbox']}}"  datatype="*" nullmsg="请输入站点默认邮箱！">
    </div>
</div>
<div class="form-group">
    <label for="settingnew[mail_to]" class="col-sm-2 control-label">邮件设置测试</label>
    <div class="col-sm-10 form-inline">
        <input class="form-control" name="settingnew[mail_to]" value="271391233@qq.com" style="float: left;width: 300px;" />
        <span class="input-group-btn">
            <button class="btn btn-default" type="button" onclick="test_mail()">测试发送</button>
        </span>
        [先保存，在发送]
    </div>
</div>
<script type="text/javascript">
    function test_mail() {
        var mail_to = $("input[name='settingnew[mail_to]']").val();
        if (mail_to == '') {
            layer.alert('请输入邮件测试地址！');
            return false;
        }
        $.ajax({
            type: 'POST',
            url: '/admin/setting/public_test_mail.html',
            data: "mail_to=" + mail_to,
            success: function (msg) {
                layer.alert(msg);
            }
        })
    }
</script>
